import java.io.UnsupportedEncodingException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: fzykd
 * Date: 2023-05-08
 * Time: 20:17
 */

public abstract class OrganizationComponent {

    private String name;
    private String des;

    //因为存在叶节点 就是最底层的节点 最底层的节点 是不需要这些方法的
    //如果写成抽象方法 叶子节点也要重写
    protected void add(OrganizationComponent organizationComponent){
        //默认实现  抛出不支持操作的异常
        throw new UnsupportedOperationException();
    }

    protected void remove(OrganizationComponent organizationComponent){
        //默认实现
        throw new UnsupportedOperationException();
    }

    //构造器
    public OrganizationComponent(String name,String des){
        super();
        this.name = name;
        this.des = des;
    }

    //打印方法  下面的子类都修要实现
    protected abstract void print();

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDes() {
        return des;
    }

    public void setDes(String des) {
        this.des = des;
    }


}
